package com.own.component.security.em;

import com.own.base.BaseResponseCode;
import lombok.AllArgsConstructor;

/**
 * SecurityExceptionEnum
 *
 * @author chenxueli
 * @date 2023-10-11 15:24:45
 */
@AllArgsConstructor
@SuppressWarnings("all")
public enum SecurityExceptionEnum implements BaseResponseCode {

    DEFAULT("login_error", "login_error"),
    USER_NOT_FOUND("login_error", "用户名或密码错误！"),
    PASSWORD_ERROR("login_error", "用户名或密码错误！"),
    TOKEN_ERROR("token_error", "token机制错误，请联系管理员"),
    PUBLIC_KEY_IS_NULL("public_key_is_null", "公钥为空，请先获取秘钥"),
    PRIVATE_KEY_IS_NULL("private_key_is_null", "私钥为空，请先获取秘钥"),
    ACCOUNT_BAN("account_ban", "账号已经被禁用，封禁时间于%s结束"),
    ACCOUNT_FREEZE("account_freeze", "账号已经被冻结，冻结时间于%s结束"),
    ACCOUNT_AUDIT("account_audit", "账号正在审核中"),
    CLIENT_ERROR("client_error", "该账号无法访问当前客户端，请使用其他方式访问"),
    SYSTEM_IP_NOT_ALLOWED("system_ip_not_allowed", "系统设置了访问ip限制，当前网络无法访问"),
    SECURITY_IP_NOT_ALLOWED("security_ip_not_allowed", "账号设置了访问ip限制，当前网络无法访问"),
    PASSWORD_NOT_ALLOWED("password_not_allowed", "账号设置了登录限制，无法通过账号密码访问"),
    SMS_NOT_ALLOWED("sms_not_allowed", "账号设置了登录限制，无法通过手机验证码访问"),
    ;

    private final String code;

    private final String desc;

    @Override
    public String code() {
        return this.code;
    }

    @Override
    public String desc() {
        return this.desc;
    }

}
